package com.overlord.im.web.user.controller;

import com.overlord.im.web.commons.Response;
import com.overlord.im.web.user.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * All rights Reserved, Designed By www.szy.cn
 *
 * @author wuwei
 * @title LoginController
 * @package com.overlord.im.web.user.controller
 * @date 2021-03-19 14:59
 * @Copyright 2014-现在 All rights reserved. 厦门神州鹰软件科技有限公司
 */
@RestController
public class LoginController {

    @Resource
    private UserService userService;

    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public Response<String> login(@RequestParam String loginName, @RequestParam String passWord) {
        String token = userService.login(loginName, passWord);
        return Response.newOk(token);
    }
}
